package dao

import (
	"time"
)

// 这是 CmsSubjectComment 的全局公开dao对象，被service层调用!
var CmsSubjectCommentDao = cmsSubjectCommentDao{}

// 这是 cms_subject_comment表 的实体类
type CmsSubjectComment struct {
	Content        string    `json:"content" form:"content" v:"content"`
	CreateTime     time.Time `json:"create_time" form:"create_time" v:"create_time"`
	Id             int64     `json:"id" form:"id" v:"id"`
	MemberIcon     string    `json:"member_icon" form:"member_icon" v:"member_icon"`
	MemberNickName string    `json:"member_nick_name" form:"member_nick_name" v:"member_nick_name"`
	ShowStatus     int32     `json:"show_status" form:"show_status" v:"show_status"`
	SubjectId      int64     `json:"subject_id" form:"subject_id" v:"subject_id"` // 这是一个逻辑外键,关联cms_subject(id)

}

// 注意:这是 CmsSubjectComment 的私有dao对象，只能在dao层内使用!
type cmsSubjectCommentDao struct {
	InsertTemplate func(arg CmsSubjectComment) (int64, error)                               //插入一条记录
	UpdateTemplate func(arg CmsSubjectComment) (int64, error)                               //更新一条记录
	DeleteTemplate func(id int64) (int64, error)                                            `args:"id"`                         //根据传入的主键删除一条记录
	SelectTemplate func(id int64) (CmsSubjectComment, error)                                `args:"id"`                         //根据传入的主键获取一条记录
	List           func(keyword string, pageNum, pageSize int) ([]CmsSubjectComment, error) `args:"keyword,page_num,page_size"` //模糊分页查询
}

/*
// 这是 cms_subject_comment 表的Postman测试参数
// 该结构体中的字段就是: 前后端交互的json字段!
type CmsSubjectCommentPostman struct {
content
create_time
id
member_icon
member_nick_name
show_status
subject_id

}*/

// 这是 cms_subject_comment 表的批量请求参数
type CmsSubjectCommentReq struct {
	List []CmsSubjectComment `json:"list" form:"list"`
}
